package com.seafwg.aopanno.aspect;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @Author seafwg
 * @Date 2022/3/9 2:41 下午
 * @Version 1.0
 * @description xxx
 */
@Component("myAspect")
@Aspect
public class MyAspect {

    // 使用一个空方法定义Pointcut
    @Pointcut("execution(* com.seafwg.aopanno.*.*.*(..))")
    public void myPointcut() {}

    @Before("myPointcut()")
    public void before() {
        System.out.println("前置增强方法...");
    }

    @AfterReturning("myPointcut()")
    public void afterReturning() {
        System.out.println("后置方法的增强...");
    }

}
